package com.atgugui.educms.controller;

import com.atgugui.commonutils.Result;
import com.atgugui.educms.entity.CrmBanner;
import com.atgugui.educms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * 用户显示Banner的控制层
 */
@Api(tags = "Banner前台控制层接口")
@RestController
@CrossOrigin
@RequestMapping("/educms/bannerFront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;


    @ApiOperation(value = "查询所有Banner")
    @GetMapping("/getAllBanner")
    public Result getAllBanncer() {
        List<CrmBanner> bannerList = crmBannerService.getAllBannsers();
        return Result.ok().data("bannerList",bannerList);
    }
}
